<br>
<div class="panel panel-default shadowed">
    <div class="panel-heading clearfix">
        <h2 class="panel-title pull-left">Trucks</h2>
        <div class="pull-right">
            <form class="form">
                <input type="text" class="form-control" ng-model="rsc.searchTruck" placeholder="Search...">
            </form>
        </div>
        <div class="pull-right">
            <button type="button" class="btn btn-primary" ng-click="rsc.editResource(undefined, 'editTruck', rsc.URLS.TRUCKS_URL, rsc.RESOURCES.TRUCKS)"><span class="fa fa-plus"></span> Truck</button>
        </div>
    </div>
    <div class="panel-body">
        <table class="table table-hover table-mouse-hover">
            <thead>
            <tr>
                <th>Truck Type</th>
                <th>Capacity</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="truck in rsc.trucks| filter: rsc.searchTruck" ng-click="rsc.editResource(truck, 'editTruck', rsc.URLS.TRUCKS_URL, rsc.RESOURCES.TRUCKS)">
                <td>{{truck.truck_type}}</td>
                <td>{{truck.capacity}}</td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

<script type="text/ng-template" id="editTruck">
    <div class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="editTruckLabel">Edit Truck</h4>
                </div>
                <div class="modal-body">
                    <form role="form">
                        <div class="row">
                            <div class="form-group col-md-6">
                                <label for="type">Truck Type</label>
                                <input type="text" ng-model="erc.resource.truck_type" class="form-control" id="type">
                            </div>
                            <div class="form-group col-md-6">
                                <label for="capacity">Capacity</label>
                                <input type="text" ng-model="erc.resource.capacity" class="form-control" id="capacity">
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-warning" data-dismiss="modal" ng-click="erc.close('none')">
                        <span class="fa fa-close"></span> Cancel
                    </button>
                    <button type="button" class="btn btn-success" data-dismiss="modal" ng-click="erc.close('update')" ng-show="erc.isDeleteAllowed()">
                        <span class="fa fa-check"></span> Update Truck
                    </button>
                    <button type="button" class="btn btn-success" data-dismiss="modal" ng-click="erc.close('add')" ng-show="!erc.isDeleteAllowed()">
                        <span class="fa fa-check"></span> Add Truck
                    </button>
                    <button type="button" class="btn btn-danger" data-dismiss="modal" ng-click="erc.close('delete')" ng-show="erc.isDeleteAllowed()">
                        <span class="fa fa-trash"></span> Delete Truck
                    </button>
                </div>
            </div>
        </div>
    </div>
</script>